const defaultState = {
  token: "",
  info: null,
};

export default function userReducer(state = defaultState, action) {
  switch (action.type) {
    case "SET_TOKEN":
      return {
        ...state,
        token: action.payload,
      };
    case "SET_INFO":
      return {
        ...state,
        info: action.payload,
      };

    default:
      return state;
  }
}
